{% extends 'core/panels/panel.html' %}

{% block panel-body %}
{% with ctx=panel.context %}
<ul class="list-group list-group-flush">
    {% if ctx.name %}
    <li class="list-group-item">
        <span class="list-item-key"><b>source:</b></span>
	{% with url=ctx.url|default:"#" %}
	<a href="{{ url }}">{{ ctx.name }}</a>
	{% endwith %}
	{% if ctx.priority %}
	(<span title="priority">{{ ctx.priority }}</span>, <span title="section">{{ ctx.section }}</span>)
	{% endif %}
    </li>
    {% endif %}

    {% if ctx.version %}
    <li class="list-group-item">
        <span class="list-item-key"><b>version:</b></span>
        {{ ctx.version }}
    </li>
    {% endif %}

    {% if ctx.maintainer %}
    <li class="list-group-item">
        <span class="list-item-key"><b>maintainer:</b></span>
	{% with mailto="mailto:"|add:ctx.maintainer.email %}
	{% with url=ctx.maintainer.developer_info_url|default:mailto %}
	<a href="{{ url }}">{{ ctx.maintainer.name }}</a>
	{% endwith %}{% endwith %}
	{% with developer=ctx.maintainer %}
	    {% if developer.archive_url %}
		<small>
		    (<a href="{{ developer.archive_url }}" title="Archives for the {{ developer.name }} list">archive</a>)
		</small>
	    {% endif %}
	    {% for extra in developer.extra %}
		<small>
		[<a href="{{ extra.link }}" title="{{ extra.description }}">{{ extra.display }}</a>]
		</small>
	    {% endfor %}
	{% endwith %}
    </li>
    {% endif %}

    {% if ctx.uploaders %}
    <li class="list-group-item">
        <span class="list-item-key"><b>uploaders:</b></span>
	{% for uploader in ctx.uploaders %}
	    {% with mailto="mailto:"|add:uploader.email %}
	    {% with url=uploader.developer_info_url|default:mailto %}
	    <a href="{{ url }}">{{ uploader.name }}</a>
	    {% endwith %}{% endwith %}
	    {% with developer=uploader %}
	    {% if developer.archive_url %}
		<small>
		    (<a href="{{ developer.archive_url }}" title="Archives for the {{ developer.name }} list">archive</a>)
		</small>
	    {% endif %}
	    {% for extra in developer.extra %}
		<small>
		[<a href="{{ extra.link }}" title="{{ extra.description }}">{{ extra.display }}</a>]
		</small>
	    {% endfor %}
	    {% endwith %}
	    {% if not forloop.last %}
	    –
	    {% endif %}
	{% endfor %}
    </li>
    {% endif %}

    {% if ctx.architectures %}
    <li class="list-group-item">
        <span class="list-item-key"><b>arch:</b></span>
        {% for arch in ctx.architectures %}{{ arch }} {% endfor %}
    </li>
    {% endif %}

    {% if ctx.standards_version %}
    <li class="list-group-item">
        <span class="list-item-key"><b>std-ver:</b></span>
        {{ ctx.standards_version }}
    </li>
    {% endif %}

    {% if ctx.vcs %}
    <li class="list-group-item">
        <span class="list-item-key"><b>VCS:</b></span>
	{% with vcs=ctx.vcs.full_name|default:ctx.vcs.type %}
	{% if vcs|lower == "cvs" %}
	<span title="{{ ctx.vcs.url }}">{{ vcs }}</span>
	{% else %}
	<a href="{{ ctx.vcs.url }}">{{ vcs }}</a>
	{% endif %}
	{% if ctx.vcs.browser %}
	(<a href="{{ ctx.vcs.browser }}">Browse</a>)
	{% endif %}
	{% endwith %}
    </li>
    {% endif %}
</ul>
{% endwith %}
{% endblock %}
